package com.starwish.starwishblog.mapper;

import com.starwish.starwishblog.entity.Tag;
import com.starwish.starwishblog.vo.TagVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface TagMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Tag record);

    Tag selectByPrimaryKey(Integer id);

    List<Tag> selectAll();

    int updateByPrimaryKey(Tag record);

    List<Tag> selectTagByCons(String name);

    void deleteById(@Param("id") Integer id );

    int insertBatch(@Param("tags")List<Tag> tags);

    int insertIntoArticleTagBatch(@Param("aid") Integer aid, @Param("tids") List<Integer> tids);

    List<Tag> selectTagsByArticleId(@Param("articleId") Integer articleId);


    int insertTagFront(Tag tag);

    int insertIntoArticleTag(@Param("aid") Integer articleId, @Param("tid") Integer tid);

    Integer deleteByTid(@Param("id") Integer id);

    int deleteArticleTagByTid(@Param("tid") Integer id);

    List<Tag> selectHotTags();
}